Component({
    properties: {
        record: {}
    },
    methods: {
        confirmHandle() {
            const {id, price, name, image, status,endTime} = this.data.record
            if (status === 2) return wx.showModal({
                title: '不可预定',
                content: `当前包间正在使用中,请选择其他包间或者在 ${endTime} 后再来预定!`,
                showCancel: false,
                confirmText:'确定',
            })
            const payload = {id, price, name, image}
            this.triggerEvent('confirm', payload)
        },
        previewHandle() {
            const {image} = this.data.record
            wx.previewImage({
                urls: [image],
            })
        }
    }
});
